﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EventManager.Model.Factory
{
    public class DbFactory : Disposable, IDbFactory
    {
        private EMDbContext _context;

        public EMDbContext Get()
        {
            return _context ?? (_context = new EMDbContext());
        }

        protected override void DisposeCore()
        {
            _context.Dispose();
        }
    }
}
